openapi: 3.1.0
info:
  title: CRM DDD PoC
  version: 1.0.0
paths:
  /auth/users/me:
    get:
      tags:
        - authentication
      summary: Get Current User Data
      operationId: get_current_user_data_auth_users_me_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserReadModel'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
        '403':
          description: Disabled account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
      security:
        - HTTPBearer: []
  /customers/:
    get:
      tags:
        - customers
      summary: Get Customers
      operationId: get_customers_customers__get
      security:
        - HTTPBearer: []
      parameters:
        - name: relation_manager_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Relation Manager Id
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/CustomerStatusName'
              - type: 'null'
            title: Status
        - name: company_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Company Name
        - name: industry
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - technology
                  - healthcare
                  - finance
                  - retail
                  - manufacturing
                  - education
                  - real estate
                  - energy
                  - hospitality
                  - transportation & logistics
                  - media & entertainment
                  - non-profit
                  - agriculture
                  - legal services
                  - government
                  - professional services
                  - automotive
                type: string
              - type: 'null'
            title: Industry
        - name: company_size
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - micro
                  - small
                  - medium
                  - large
                type: string
              - type: 'null'
            title: Company Size
        - name: legal_form
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - sole proprietorship
                  - partnership
                  - limited
                  - joint-stock
                  - other
                type: string
              - type: 'null'
            title: Legal Form
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerReadModel'
                title: Response Get Customers Customers  Get
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - customers
      summary: Create Customer
      operationId: create_customer_customers__post
      security:
        - HTTPBearer: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Unprocessable Entity
  /customers/{customer_id}:
    put:
      tags:
        - customers
      summary: Update Customer
      operationId: update_customer_customers__customer_id__put
      security:
        - HTTPBearer: []
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            title: Customer Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerUpdateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Unprocessable Entity
    get:
      tags:
        - customers
      summary: Get Single Customer
      operationId: get_single_customer_customers__customer_id__get
      security:
        - HTTPBearer: []
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            title: Customer Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /customers/{customer_id}/convert:
    post:
      tags:
        - customers
      summary: Convert Customer
      operationId: convert_customer_customers__customer_id__convert_post
      security:
        - HTTPBearer: []
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            title: Customer Id
      responses:
        '204':
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Conflict
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /customers/{customer_id}/archive:
    post:
      tags:
        - customers
      summary: Archive Customer
      operationId: archive_customer_customers__customer_id__archive_post
      security:
        - HTTPBearer: []
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            title: Customer Id
      responses:
        '204':
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Unprocessable Entity
  /customers/{customer_id}/contact-persons:
    get:
      tags:
        - customers
      summary: Get Customers Contact Persons
      operationId: >-
        get_customers_contact_persons_customers__customer_id__contact_persons_get
      security:
        - HTTPBearer: []
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            title: Customer Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ContactPersonReadModel'
                title: >-
                  Response Get Customers Contact Persons Customers  Customer Id 
                  Contact Persons Get
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - customers
      summary: Create Customers Contact Person
      operationId: >-
        create_customers_contact_person_customers__customer_id__contact_persons_post
      security:
        - HTTPBearer: []
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            title: Customer Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactPersonCreateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactPersonReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Unprocessable Entity
  /customers/{customer_id}/contact-persons/{contact_person_id}:
    put:
      tags:
        - customers
      summary: Update Customers Contact Person
      operationId: >-
        update_customers_contact_person_customers__customer_id__contact_persons__contact_person_id__put
      security:
        - HTTPBearer: []
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            title: Customer Id
        - name: contact_person_id
          in: path
          required: true
          schema:
            type: string
            title: Contact Person Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactPersonUpdateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactPersonReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Unprocessable Entity
    delete:
      tags:
        - customers
      summary: Remove Customers Contact Person
      operationId: >-
        remove_customers_contact_person_customers__customer_id__contact_persons__contact_person_id__delete
      security:
        - HTTPBearer: []
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            title: Customer Id
        - name: contact_person_id
          in: path
          required: true
          schema:
            type: string
            title: Contact Person Id
      responses:
        '204':
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /countries:
    get:
      tags:
        - value objects
      summary: Get Countries
      operationId: get_countries_countries_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/CountryReadModel'
                type: array
                title: Response Get Countries Countries Get
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
      security:
        - HTTPBearer: []
  /languages:
    get:
      tags:
        - value objects
      summary: Get Languages
      operationId: get_languages_languages_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/LanguageReadModel'
                type: array
                title: Response Get Languages Languages Get
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
      security:
        - HTTPBearer: []
  /leads/:
    get:
      tags:
        - leads
      summary: Get Leads
      operationId: get_leads_leads__get
      security:
        - HTTPBearer: []
      parameters:
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Customer Id
        - name: salesman_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Salesman Id
        - name: contact_phone
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Contact Phone
        - name: contact_email
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Contact Email
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LeadReadModel'
                title: Response Get Leads Leads  Get
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - leads
      summary: Create Lead
      operationId: create_lead_leads__post
      security:
        - HTTPBearer: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadCreateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Unprocessable Entity
  /leads/{lead_id}:
    get:
      tags:
        - leads
      summary: Get Single Lead
      operationId: get_single_lead_leads__lead_id__get
      security:
        - HTTPBearer: []
      parameters:
        - name: lead_id
          in: path
          required: true
          schema:
            type: string
            title: Lead Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - leads
      summary: Update Lead
      operationId: update_lead_leads__lead_id__put
      security:
        - HTTPBearer: []
      parameters:
        - name: lead_id
          in: path
          required: true
          schema:
            type: string
            title: Lead Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadUpdateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Unprocessable Entity
  /leads/{lead_id}/assignments:
    get:
      tags:
        - leads
      summary: Get Lead Assignments
      operationId: get_lead_assignments_leads__lead_id__assignments_get
      security:
        - HTTPBearer: []
      parameters:
        - name: lead_id
          in: path
          required: true
          schema:
            type: string
            title: Lead Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AssignmentReadModel'
                title: Response Get Lead Assignments Leads  Lead Id  Assignments Get
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - leads
      summary: Assign Salesman
      operationId: assign_salesman_leads__lead_id__assignments_post
      security:
        - HTTPBearer: []
      parameters:
        - name: lead_id
          in: path
          required: true
          schema:
            type: string
            title: Lead Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignmentUpdateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssignmentReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Unprocessable Entity
  /leads/{lead_id}/notes:
    get:
      tags:
        - leads
      summary: Get Lead Notes
      operationId: get_lead_notes_leads__lead_id__notes_get
      security:
        - HTTPBearer: []
      parameters:
        - name: lead_id
          in: path
          required: true
          schema:
            type: string
            title: Lead Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/NoteReadModel'
                title: Response Get Lead Notes Leads  Lead Id  Notes Get
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - leads
      summary: Create Note
      operationId: create_note_leads__lead_id__notes_post
      security:
        - HTTPBearer: []
      parameters:
        - name: lead_id
          in: path
          required: true
          schema:
            type: string
            title: Lead Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NoteCreateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoteReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /opportunities/:
    get:
      tags:
        - opportunities
      summary: Get Opportunities
      operationId: get_opportunities_opportunities__get
      security:
        - HTTPBearer: []
      parameters:
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Customer Id
        - name: owner_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Owner Id
        - name: stage
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - qualification
                  - proposal
                  - negotiation
                  - closed-won
                  - closed-lost
                type: string
              - type: 'null'
            title: Stage
        - name: priority
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - low
                  - medium
                  - high
                  - urgent
                type: string
              - type: 'null'
            title: Priority
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OpportunityReadModel'
                title: Response Get Opportunities Opportunities  Get
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - opportunities
      summary: Create Opportunity
      operationId: create_opportunity_opportunities__post
      security:
        - HTTPBearer: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpportunityCreateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpportunityReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Unprocessable Entity
  /opportunities/{opportunity_id}:
    get:
      tags:
        - opportunities
      summary: Get Single Opportunity
      operationId: get_single_opportunity_opportunities__opportunity_id__get
      security:
        - HTTPBearer: []
      parameters:
        - name: opportunity_id
          in: path
          required: true
          schema:
            type: string
            title: Opportunity Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpportunityReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - opportunities
      summary: Update Opportunity
      operationId: update_opportunity_opportunities__opportunity_id__put
      security:
        - HTTPBearer: []
      parameters:
        - name: opportunity_id
          in: path
          required: true
          schema:
            type: string
            title: Opportunity Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpportunityUpdateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpportunityReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Unprocessable Entity
  /opportunities/{opportunity_id}/offer-items:
    get:
      tags:
        - opportunities
      summary: Get Opportunity Offer
      operationId: get_opportunity_offer_opportunities__opportunity_id__offer_items_get
      security:
        - HTTPBearer: []
      parameters:
        - name: opportunity_id
          in: path
          required: true
          schema:
            type: string
            title: Opportunity Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OfferItemReadModel'
                title: >-
                  Response Get Opportunity Offer Opportunities  Opportunity Id 
                  Offer Items Get
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - opportunities
      summary: Update Opportunity Offer
      operationId: update_opportunity_offer_opportunities__opportunity_id__offer_items_put
      security:
        - HTTPBearer: []
      parameters:
        - name: opportunity_id
          in: path
          required: true
          schema:
            type: string
            title: Opportunity Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/OfferItemCreateUpdateModel'
              title: Data
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OfferItemReadModel'
                title: >-
                  Response Update Opportunity Offer Opportunities  Opportunity
                  Id  Offer Items Put
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
          description: Unprocessable Entity
  /opportunities/{opportunity_id}/notes:
    get:
      tags:
        - opportunities
      summary: Get Opportunity Notes
      operationId: get_opportunity_notes_opportunities__opportunity_id__notes_get
      security:
        - HTTPBearer: []
      parameters:
        - name: opportunity_id
          in: path
          required: true
          schema:
            type: string
            title: Opportunity Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/NoteReadModel'
                title: >-
                  Response Get Opportunity Notes Opportunities  Opportunity Id 
                  Notes Get
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - opportunities
      summary: Create Note
      operationId: create_note_opportunities__opportunity_id__notes_post
      security:
        - HTTPBearer: []
      parameters:
        - name: opportunity_id
          in: path
          required: true
          schema:
            type: string
            title: Opportunity Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NoteCreateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoteReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /sales-representatives/:
    get:
      tags:
        - sales representatives
      summary: Get Sales Representatives
      description: For admins only.
      operationId: get_sales_representatives_sales_representatives__get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/SalesRepresentativeReadModel'
                type: array
                title: Response Get Sales Representatives Sales Representatives  Get
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
      security:
        - HTTPBearer: []
    post:
      tags:
        - sales representatives
      summary: Create Sales Representative
      description: For admins only.
      operationId: create_sales_representative_sales_representatives__post
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Body_create_sales_representative_sales_representatives__post
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SalesRepresentativeReadModel'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
      security:
        - HTTPBearer: []
  /sales-representatives/{representative_id}:
    put:
      tags:
        - sales representatives
      summary: Update Sales Representative
      operationId: >-
        update_sales_representative_sales_representatives__representative_id__put
      security:
        - HTTPBearer: []
      parameters:
        - name: representative_id
          in: path
          required: true
          schema:
            type: string
            title: Representative Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SalesRepresentativeUpdateModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SalesRepresentativeReadModel'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /currencies:
    get:
      tags:
        - value objects
      summary: Get Currencies
      operationId: get_currencies_currencies_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/CurrencyReadModel'
                type: array
                title: Response Get Currencies Currencies Get
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
      security:
        - HTTPBearer: []
  /products:
    get:
      tags:
        - value objects
      summary: Get Products
      operationId: get_products_products_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ProductReadModel'
                type: array
                title: Response Get Products Products Get
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    AddressDataCreateUpdateModel:
      properties:
        country:
          allOf:
            - $ref: '#/components/schemas/CountryCreateUpdateModel'
          examples:
            - code: PL
              name: Polska
        street:
          type: string
          title: Street
          examples:
            - Kościuszki
        street_no:
          type: string
          title: Street No
          examples:
            - '373'
        postal_code:
          type: string
          title: Postal Code
          examples:
            - 84-046
        city:
          type: string
          title: City
          examples:
            - Koło
      type: object
      required:
        - country
        - street
        - street_no
        - postal_code
        - city
      title: AddressDataCreateUpdateModel
    AssignmentReadModel:
      properties:
        previous_owner_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Owner Id
          examples:
            - 066a0aed-0a01-4344-8618-87fa9d29ecd6
        new_owner_id:
          type: string
          title: New Owner Id
          examples:
            - 1e1284b3-a1b0-43fd-857a-0f55da82d17b
        assigned_by_id:
          type: string
          title: Assigned By Id
          examples:
            - 6ed0a790-30e1-455d-ae85-7faa28f62d4f
        assigned_at:
          type: string
          format: date-time
          title: Assigned At
      type: object
      required:
        - new_owner_id
        - assigned_by_id
        - assigned_at
      title: AssignmentReadModel
    AssignmentUpdateModel:
      properties:
        new_salesman_id:
          type: string
          title: New Salesman Id
      type: object
      required:
        - new_salesman_id
      title: AssignmentUpdateModel
    BasicErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: BasicErrorResponse
    Body_create_sales_representative_sales_representatives__post:
      properties:
        salesman_data:
          $ref: '#/components/schemas/SalesRepresentativeCreateModel'
        user_data:
          $ref: '#/components/schemas/UserCreateModel'
      type: object
      required:
        - salesman_data
        - user_data
      title: Body_create_sales_representative_sales_representatives__post
    CompanyAddressReadModel:
      properties:
        country:
          type: string
          title: Country
          examples:
            - Uzbekistan
        street:
          type: string
          title: Street
          examples:
            - Błękitna
        street_no:
          type: string
          title: Street No
          examples:
            - '72'
        postal_code:
          type: string
          title: Postal Code
          examples:
            - 87-006
        city:
          type: string
          title: City
          examples:
            - Krosno
      type: object
      required:
        - country
        - street
        - street_no
        - postal_code
        - city
      title: CompanyAddressReadModel
    CompanyInfoCreateUpdateModel:
      properties:
        name:
          type: string
          title: Name
          examples:
            - PPUH Wawrzynowicz
        industry:
          type: string
          title: Industry
          examples:
            - technology
            - healthcare
            - finance
            - retail
            - manufacturing
            - education
            - real estate
            - energy
            - hospitality
            - transportation & logistics
            - media & entertainment
            - non-profit
            - agriculture
            - legal services
            - government
            - professional services
            - automotive
        size:
          type: string
          title: Size
          examples:
            - micro
            - small
            - medium
            - large
        legal_form:
          type: string
          title: Legal Form
          examples:
            - sole proprietorship
            - partnership
            - limited
            - joint-stock
            - other
        address:
          allOf:
            - $ref: '#/components/schemas/AddressDataCreateUpdateModel'
          examples:
            - city: Koło
              country:
                code: PL
                name: Polska
              postal_code: 84-046
              street: Kościuszki
              street_no: '373'
      type: object
      required:
        - name
        - industry
        - size
        - legal_form
        - address
      title: CompanyInfoCreateUpdateModel
    CompanyInfoReadModel:
      properties:
        name:
          type: string
          title: Name
          examples:
            - Fundacja Szymaniuk-Zaniewicz Sp.j.
        industry:
          type: string
          title: Industry
          examples:
            - technology
            - healthcare
            - finance
            - retail
            - manufacturing
            - education
            - real estate
            - energy
            - hospitality
            - transportation & logistics
            - media & entertainment
            - non-profit
            - agriculture
            - legal services
            - government
            - professional services
            - automotive
        size:
          type: string
          title: Size
          examples:
            - micro
            - small
            - medium
            - large
        legal_form:
          type: string
          title: Legal Form
          examples:
            - sole proprietorship
            - partnership
            - limited
            - joint-stock
            - other
        address:
          allOf:
            - $ref: '#/components/schemas/CompanyAddressReadModel'
          examples:
            - city: Krosno
              country: Uzbekistan
              postal_code: 87-006
              street: Błękitna
              street_no: '72'
      type: object
      required:
        - name
        - industry
        - size
        - legal_form
        - address
      title: CompanyInfoReadModel
    ContactDataCreateUpdateModel:
      properties:
        first_name:
          type: string
          title: First Name
          examples:
            - Artur
        last_name:
          type: string
          title: Last Name
          examples:
            - Zbiciak
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
          examples:
            - +48 22 599 67 74
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          examples:
            - dawidhandke@example.org
      type: object
      required:
        - first_name
        - last_name
      title: ContactDataCreateUpdateModel
    ContactDataReadModel:
      properties:
        first_name:
          type: string
          title: First Name
          examples:
            - Emil
        last_name:
          type: string
          title: Last Name
          examples:
            - Mędrala
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
          examples:
            - +48 885 573 045
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          examples:
            - konradduszkiewicz@example.org
      type: object
      required:
        - first_name
        - last_name
      title: ContactDataReadModel
    ContactMethodCreateUpdateModel:
      properties:
        type:
          type: string
          title: Type
          examples:
            - email
            - phone
        value:
          type: string
          title: Value
          examples:
            - rafal66@example.com
            - +48 781 944 245
        is_preferred:
          type: boolean
          title: Is Preferred
          examples:
            - true
      type: object
      required:
        - type
        - value
        - is_preferred
      title: ContactMethodCreateUpdateModel
    ContactMethodReadModel:
      properties:
        type:
          type: string
          title: Type
          examples:
            - email
            - phone
        value:
          type: string
          title: Value
          examples:
            - natankumorek@example.org
            - +48 781 018 033
        is_preferred:
          type: boolean
          title: Is Preferred
          examples:
            - true
      type: object
      required:
        - type
        - value
        - is_preferred
      title: ContactMethodReadModel
    ContactPersonCreateModel:
      properties:
        first_name:
          type: string
          title: First Name
          examples:
            - Adrianna
        last_name:
          type: string
          title: Last Name
          examples:
            - Klemens
        job_title:
          type: string
          title: Job Title
          examples:
            - Syndyk
        preferred_language:
          allOf:
            - $ref: '#/components/schemas/LanguageCreateUpdateModel'
          examples:
            - code: pl
              name: Polish
        contact_methods:
          items:
            $ref: '#/components/schemas/ContactMethodCreateUpdateModel'
          type: array
          title: Contact Methods
          examples:
            - - is_preferred: true
                type: email
                value: +48 781 944 245
      type: object
      required:
        - first_name
        - last_name
        - job_title
        - preferred_language
        - contact_methods
      title: ContactPersonCreateModel
    ContactPersonReadModel:
      properties:
        id:
          type: string
          title: Id
          examples:
            - 2e7dee7b-2270-43e6-8b72-6fd40fdf38ea
        first_name:
          type: string
          title: First Name
          examples:
            - Ewelina
        last_name:
          type: string
          title: Last Name
          examples:
            - Misiejuk
        job_title:
          type: string
          title: Job Title
          examples:
            - Technik kelner
        preferred_language:
          allOf:
            - $ref: '#/components/schemas/LanguageReadModel'
          examples:
            - code: pl
              name: Polish
        contact_methods:
          items:
            $ref: '#/components/schemas/ContactMethodReadModel'
          type: array
          title: Contact Methods
          examples:
            - - is_preferred: true
                type: phone
                value: natankumorek@example.org
      type: object
      required:
        - id
        - first_name
        - last_name
        - job_title
        - preferred_language
        - contact_methods
      title: ContactPersonReadModel
    ContactPersonUpdateModel:
      properties:
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
          examples:
            - Aurelia
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
          examples:
            - Lampa
        job_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Job Title
          examples:
            - Dubler
        preferred_language:
          anyOf:
            - $ref: '#/components/schemas/LanguageCreateUpdateModel'
            - type: 'null'
          examples:
            - code: pl
              name: Polish
        contact_methods:
          anyOf:
            - items:
                $ref: '#/components/schemas/ContactMethodCreateUpdateModel'
              type: array
            - type: 'null'
          title: Contact Methods
          examples:
            - - is_preferred: true
                type: email
                value: rafal66@example.com
      type: object
      title: ContactPersonUpdateModel
    CountryCreateUpdateModel:
      properties:
        name:
          type: string
          title: Name
          examples:
            - Polska
        code:
          type: string
          title: Code
          examples:
            - PL
      type: object
      required:
        - name
        - code
      title: CountryCreateUpdateModel
    CountryReadModel:
      properties:
        code:
          type: string
          title: Code
          examples:
            - FR
        name:
          type: string
          title: Name
          examples:
            - Algeria
      type: object
      required:
        - code
        - name
      title: CountryReadModel
    CurrencyCreateUpdateModel:
      properties:
        name:
          type: string
          title: Name
          examples:
            - Bahraini dinar
        iso_code:
          type: string
          title: Iso Code
          examples:
            - KMF
      type: object
      required:
        - name
        - iso_code
      title: CurrencyCreateUpdateModel
    CurrencyReadModel:
      properties:
        name:
          type: string
          title: Name
          examples:
            - Hungarian forint
        iso_code:
          type: string
          title: Iso Code
          examples:
            - LTL
      type: object
      required:
        - name
        - iso_code
      title: CurrencyReadModel
    CustomerCreateModel:
      properties:
        relation_manager_id:
          type: string
          title: Relation Manager Id
          examples:
            - 1144a4f9-d6a7-4563-81b3-e9f71d155e06
        company_info:
          allOf:
            - $ref: '#/components/schemas/CompanyInfoCreateUpdateModel'
          examples:
            - address:
                city: Koło
                country:
                  code: PL
                  name: Polska
                postal_code: 84-046
                street: Kościuszki
                street_no: '373'
              industry: healthcare
              legal_form: sole proprietorship
              name: PPUH Wawrzynowicz
              size: small
      type: object
      required:
        - relation_manager_id
        - company_info
      title: CustomerCreateModel
    CustomerReadModel:
      properties:
        id:
          type: string
          title: Id
          examples:
            - 7e88f666-62ab-450e-9e9d-05b228b2f7f5
        relation_manager_id:
          type: string
          title: Relation Manager Id
          examples:
            - a25aa36c-602a-4901-8332-99411e7f774a
        status:
          type: string
          title: Status
          examples:
            - initial
            - converted
            - archived
        company_info:
          allOf:
            - $ref: '#/components/schemas/CompanyInfoReadModel'
          examples:
            - address:
                city: Krosno
                country: Uzbekistan
                postal_code: 87-006
                street: Błękitna
                street_no: '72'
              industry: transportation & logistics
              legal_form: joint-stock
              name: Fundacja Szymaniuk-Zaniewicz Sp.j.
              size: medium
      type: object
      required:
        - id
        - relation_manager_id
        - status
        - company_info
      title: CustomerReadModel
    CustomerStatusName:
      type: string
      enum:
        - initial
        - converted
        - archived
      title: CustomerStatusName
    CustomerUpdateModel:
      properties:
        relation_manager_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Relation Manager Id
          examples:
            - d91d9874-c1c0-4b42-8594-d0131d5ff628
        company_info:
          anyOf:
            - $ref: '#/components/schemas/CompanyInfoCreateUpdateModel'
            - type: 'null'
          examples:
            - address:
                city: Koło
                country:
                  code: PL
                  name: Polska
                postal_code: 84-046
                street: Kościuszki
                street_no: '373'
              industry: technology
              legal_form: sole proprietorship
              name: PPUH Wawrzynowicz
              size: micro
      type: object
      title: CustomerUpdateModel
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LanguageCreateUpdateModel:
      properties:
        name:
          type: string
          title: Name
          examples:
            - Polish
        code:
          type: string
          title: Code
          examples:
            - pl
      type: object
      required:
        - name
        - code
      title: LanguageCreateUpdateModel
    LanguageReadModel:
      properties:
        name:
          type: string
          title: Name
          examples:
            - Polish
        code:
          type: string
          title: Code
          examples:
            - pl
      type: object
      required:
        - name
        - code
      title: LanguageReadModel
    LeadCreateModel:
      properties:
        customer_id:
          type: string
          title: Customer Id
          examples:
            - e0c97e68-5933-42cb-8019-5b87c6edcaf8
        source:
          type: string
          title: Source
          examples:
            - social media
            - website
            - cold call
            - ads
            - referral
            - event
            - other
        contact_data:
          allOf:
            - $ref: '#/components/schemas/ContactDataCreateUpdateModel'
          examples:
            - email: dawidhandke@example.org
              first_name: Artur
              last_name: Zbiciak
              phone: +48 22 599 67 74
      type: object
      required:
        - customer_id
        - source
        - contact_data
      title: LeadCreateModel
    LeadReadModel:
      properties:
        id:
          type: string
          title: Id
          examples:
            - db8eeee4-6d2e-424f-89d4-855c3c6a3af2
        customer_id:
          type: string
          title: Customer Id
          examples:
            - c900f9ac-22bd-4ae4-800c-3d4327519387
        created_by_salesman_id:
          type: string
          title: Created By Salesman Id
          examples:
            - a06c7c79-ab44-498d-bd83-3f69b898d0c7
        assigned_salesman_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assigned Salesman Id
          examples:
            - 0faead9b-8918-47f5-ab32-2601b7e5636e
        created_at:
          type: string
          format: date-time
          title: Created At
        source:
          type: string
          title: Source
          examples:
            - social media
            - website
            - cold call
            - ads
            - referral
            - event
            - other
        contact_data:
          allOf:
            - $ref: '#/components/schemas/ContactDataReadModel'
          examples:
            - email: konradduszkiewicz@example.org
              first_name: Emil
              last_name: Mędrala
              phone: +48 885 573 045
      type: object
      required:
        - id
        - customer_id
        - created_by_salesman_id
        - assigned_salesman_id
        - created_at
        - source
        - contact_data
      title: LeadReadModel
    LeadUpdateModel:
      properties:
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
          examples:
            - social media
            - website
            - cold call
            - ads
            - referral
            - event
            - other
        contact_data:
          anyOf:
            - $ref: '#/components/schemas/ContactDataCreateUpdateModel'
            - type: 'null'
          examples:
            - email: dawidhandke@example.org
              first_name: Artur
              last_name: Zbiciak
              phone: +48 22 599 67 74
      type: object
      title: LeadUpdateModel
    MoneyCreateUpdateModel:
      properties:
        currency:
          allOf:
            - $ref: '#/components/schemas/CurrencyCreateUpdateModel'
          examples:
            - iso_code: KMF
              name: Bahraini dinar
        amount:
          anyOf:
            - type: number
            - type: string
          title: Amount
          examples:
            - '720.22'
      type: object
      required:
        - currency
        - amount
      title: MoneyCreateUpdateModel
    MoneyReadModel:
      properties:
        currency:
          allOf:
            - $ref: '#/components/schemas/CurrencyReadModel'
          examples:
            - iso_code: LTL
              name: Hungarian forint
        amount:
          type: string
          title: Amount
          examples:
            - '465.21'
      type: object
      required:
        - currency
        - amount
      title: MoneyReadModel
    NoteCreateModel:
      properties:
        content:
          type: string
          title: Content
          examples:
            - Ani decyzja rząd chory.
      type: object
      required:
        - content
      title: NoteCreateModel
    NoteReadModel:
      properties:
        created_by_id:
          type: string
          title: Created By Id
          examples:
            - 6405ec42-146d-456c-b260-1186ebce4d42
        content:
          type: string
          title: Content
          examples:
            - Moc narzędzie kłopot liczba.
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - created_by_id
        - content
        - created_at
      title: NoteReadModel
    OfferItemCreateUpdateModel:
      properties:
        product:
          allOf:
            - $ref: '#/components/schemas/ProductCreateUpdateModel'
          examples:
            - name: Right-sized systematic functionalities
        value:
          allOf:
            - $ref: '#/components/schemas/MoneyCreateUpdateModel'
          examples:
            - amount: '720.22'
              currency:
                iso_code: KMF
                name: Bahraini dinar
      type: object
      required:
        - product
        - value
      title: OfferItemCreateUpdateModel
    OfferItemReadModel:
      properties:
        product:
          allOf:
            - $ref: '#/components/schemas/ProductReadModel'
          examples:
            - name: Managed maximized process improvement
        value:
          allOf:
            - $ref: '#/components/schemas/MoneyReadModel'
          examples:
            - amount: '465.21'
              currency:
                iso_code: LTL
                name: Hungarian forint
      type: object
      required:
        - product
        - value
      title: OfferItemReadModel
    OpportunityCreateModel:
      properties:
        customer_id:
          type: string
          title: Customer Id
          examples:
            - 3dd739af-3b02-4a5d-8036-398bea0ec457
        source:
          type: string
          title: Source
          examples:
            - social media
            - website
            - cold call
            - ads
            - referral
            - event
            - other
        priority:
          type: string
          title: Priority
          examples:
            - low
            - medium
            - high
            - urgent
        offer:
          items:
            $ref: '#/components/schemas/OfferItemCreateUpdateModel'
          type: array
          title: Offer
          examples:
            - - product:
                  name: Right-sized systematic functionalities
                value:
                  amount: '720.22'
                  currency:
                    iso_code: KMF
                    name: Bahraini dinar
      type: object
      required:
        - customer_id
        - source
        - priority
        - offer
      title: OpportunityCreateModel
    OpportunityReadModel:
      properties:
        id:
          type: string
          title: Id
          examples:
            - 1c378cbf-7bde-4179-ac50-9109286c76e3
        source:
          type: string
          title: Source
          examples:
            - social media
            - website
            - cold call
            - ads
            - referral
            - event
            - other
        stage:
          type: string
          title: Stage
          examples:
            - qualification
            - proposal
            - negotiation
            - closed-won
            - closed-lost
        priority:
          type: string
          title: Priority
          examples:
            - low
            - medium
            - high
            - urgent
        created_by_id:
          type: string
          title: Created By Id
          examples:
            - d5fa298e-7ca8-49c5-8a6a-c8c83680da80
        customer_id:
          type: string
          title: Customer Id
          examples:
            - e3eabca9-6772-43ce-8c33-511f5335da97
        owner_id:
          type: string
          title: Owner Id
          examples:
            - d74c5e45-ff80-4a31-9f03-f9eb44b2078a
        created_at:
          type: string
          format: date-time
          title: Created At
          examples:
            - '2026-03-05T19:29:51.616376Z'
      type: object
      required:
        - id
        - source
        - stage
        - priority
        - created_by_id
        - customer_id
        - owner_id
        - created_at
      title: OpportunityReadModel
    OpportunityUpdateModel:
      properties:
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
          examples:
            - social media
            - website
            - cold call
            - ads
            - referral
            - event
            - other
        priority:
          anyOf:
            - type: string
            - type: 'null'
          title: Priority
          examples:
            - low
            - medium
            - high
            - urgent
        stage:
          anyOf:
            - type: string
            - type: 'null'
          title: Stage
          examples:
            - qualification
            - proposal
            - negotiation
            - closed-won
            - closed-lost
      type: object
      title: OpportunityUpdateModel
    ProductCreateUpdateModel:
      properties:
        name:
          type: string
          title: Name
          examples:
            - Right-sized systematic functionalities
      type: object
      required:
        - name
      title: ProductCreateUpdateModel
    ProductReadModel:
      properties:
        name:
          type: string
          title: Name
          examples:
            - Managed maximized process improvement
      type: object
      required:
        - name
      title: ProductReadModel
    SalesRepresentativeCreateModel:
      properties:
        first_name:
          type: string
          title: First Name
          examples:
            - Karol
        last_name:
          type: string
          title: Last Name
          examples:
            - Elwart
      type: object
      required:
        - first_name
        - last_name
      title: SalesRepresentativeCreateModel
    SalesRepresentativeReadModel:
      properties:
        id:
          type: string
          title: Id
          examples:
            - 5fd9a6be-7353-40b5-aa97-3c7b9218608e
        first_name:
          type: string
          title: First Name
          examples:
            - Fryderyk
        last_name:
          type: string
          title: Last Name
          examples:
            - Ziółko
      type: object
      required:
        - id
        - first_name
        - last_name
      title: SalesRepresentativeReadModel
    SalesRepresentativeUpdateModel:
      properties:
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
          examples:
            - Błażej
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
          examples:
            - Gubernat
      type: object
      title: SalesRepresentativeUpdateModel
    UnprocessableEntityErrorDetails:
      properties:
        msg:
          type: string
          title: Msg
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        loc:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: string
              type: array
            - type: 'null'
          title: Loc
        input:
          title: Input
      type: object
      required:
        - msg
        - input
      title: UnprocessableEntityErrorDetails
    UnprocessableEntityResponse:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/UnprocessableEntityErrorDetails'
          type: array
          title: Detail
      type: object
      required:
        - detail
      title: UnprocessableEntityResponse
    UserCreateModel:
      properties:
        email:
          type: string
          format: email
          title: Email
      type: object
      required:
        - email
      title: UserCreateModel
    UserReadModel:
      properties:
        id:
          type: string
          title: Id
          examples:
            - 456cc656-4ab2-4e9e-ae66-58e09f522891
        salesman_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Salesman Id
          examples:
            - a0a819b4-cccd-4ad0-be2c-4e96740fa3eb
        roles:
          items:
            type: string
          type: array
          title: Roles
          examples:
            - - admin
      type: object
      required:
        - id
        - salesman_id
        - roles
      title: UserReadModel
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
